<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>reduce实现数组去重</title>
</head>
<body>
    <script>
        var list=[
            {
                name:'圣罗兰小羊皮304',
                jiage:340,
                shuliang:2,
            },
            {
                name:'jk制服',
                jiage:680,
                shuliang:4,
            },
            {
                name:'瓦尔登湖',
                jiage:70,
                shuliang:8,
            },
        ]
        var res=list.reduce(function(pre,cur,index){
            return pre+cur.jiage*cur.shuliang
        },0)
    </script>
    
</body>
</html>